<?php include "../config.php";?>
<?php session_start(); ?>
<?php include "controller/script/patch.php";?>
<!--/*验证码的session开始，如果不放在前面，有的服务器会出现警告*/-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>企业资源计划系统</title>
    <link href="asset/css/index.css" rel="stylesheet" type="text/css"/>
    <script type="text/javascript" src="asset/js/viewport.js"></script>

</head>


<body>
<?

if(!isset($_REQUEST['username']) or $_REQUEST['username']=='')
{
    $_REQUEST['username']='';
    $_REQUEST['userpass']='';
}
?>

<div id="width_height">

    <div id="help" onclick="help()">
        <img src="asset/image/help_logo.png"/>帮助</div>
    <script> function help(){ alert('资料收集中！'); }</script>


    <div class="gate_content">

        <div id="logo">
            <img src="asset/image/logo_m.png" >
            <h5>企业资源计划系统</h5>
        </div>


        <div id="content_form">
            <form id="loginform" name="loginform" method="post" action="" enctype="multipart/form-data">
                <ul>

                    <input type="hidden" name="unit" id="unit" value="<? echo $_REQUEST['unit'] ?>"/>
                    <?
                    $now_unit             = str_replace("/login/", "", $_REQUEST['unit']);
                    setcookie("unit", $now_unit , time() + 365 * 24 * 3600,"/");
                    ?>



                    <li><label class="icon_1"></label>
                        <input type="text" name="account" alt="账号" id="account"
                               value="<? echo $_REQUEST['account'] ?>"
                               placeholder="账号"/>
                    </li>

                    <li><label class="icon_2"></label>
                        <input type="password" name="password" id="password" alt=""
                               value="<? echo $_REQUEST['password'] ?>"
                               placeholder="密码"/>
                    </li>

                    <li>
                        <input type="text" name="code" id="code" style="float: left;width: 150px;;" alt="验证码"  />

                        <img src="../application/verify/z_imgcode.php" onclick='this.src="../application/verify/z_imgcode.php?"+Math.random();' style="cursor:pointer;height: 50px;width: 150px;">
                    </li>
                    <?php
                    if(isset($_REQUEST['code'])){
                        if($_REQUEST['code'] == strtolower($_SESSION['yzm'])){
                            echo "
		<script type='text/javascript'>
		document.getElementById('loginform').action = 'logincheck.php';
        document.getElementById('loginform').submit();
		</script>";
                        }else{
                            echo '<script type="text/javascript"> alert("请输入正确的验证码！");</script>';
                        }
                    }
                    ?>


                    <input type="submit" name="submit" id='submit' value="登　陆" />

                </ul>


                <!--<div class="item box">-->
                <!--    <div class="noaccount"><a href="/login/register.php">立刻注册</a></div>-->
                <!--    <div class="forget"><a href="resetpass_send.php">忘记密码</a></div>-->
                <!--</div>-->


            </form>

            <ul id="foger_regist">
                <!--	  <li>忘记密码</li>
                      <li>注册登录</li>-->
                <!--<li onclick="bangdingweixin()">绑定微信</li>-->
            </ul>


        </div>
    </div>

</div>

<canvas id="Mycanvas"></canvas>

<script type="text/javascript" src="asset/js/index_animation.js"></script>

<script>
    function bangdingweixin(){
        alert("功能准备开发，敬请期待！")
    }
</script>
</body>
</html>